﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace GrewalCRM.Entities
{  
  public class ReffStatus : BaseEntitiesGrewalCRM
  {
    #region Members  
    private int statusID;
    private string statusName;
    private string description;
    #endregion

    #region Constructors
    /// <summary>
    /// Create a new instance using the default constructor
    /// </summary>
    public ReffStatus()
    {
      
    }
    
    /// <summary> 
    /// Create a new object by specifying all fields (except the auto-generated primary key field). 
    /// </summary> 
    public ReffStatus(string statusName, string description, UserCRM lastModifiedUser):base(lastModifiedUser)
    {      
      this.statusName = statusName;
      this.description = description;
    }

     /// <summary> 
    /// Create an object from an existing row of data with only ID feild 
    /// </summary> 
    public ReffStatus(int statusID)
      : base(statusID, null, null)
    {
      
    }

    /// <summary> 
    /// Create an object from an existing row of data. This will be used by Gentle to 
    /// construct objects from retrieved rows. 
    /// </summary> 
    public ReffStatus(int statusID, string statusName, string description, UserCRM lastModifiedUser,DateTime? lastModifiedDateTime)
      : base(statusID, lastModifiedUser, lastModifiedDateTime)
    {
      this.statusID = statusID;
      this.statusName = statusName;
      this.description = description;
    }
    #endregion

    #region Public Properties    
    /// <summary>
    /// Property relating to database column StatusName
    /// </summary>    
    public string StatusName
    {
      get { return statusName != null ? statusName.TrimEnd() : string.Empty; }
      set { IsChanged |= statusName != value; statusName = value; }
    }

    /// <summary>
    /// Property relating to database column Description
    /// </summary>    
    public string Description
    {
      get { return description != null ? description.TrimEnd() : string.Empty; }
      set { IsChanged |= description != value; description = value; }
    }
    #endregion
  }
}
